class Polygon:
    def __init__(self, vertices):
        self.vertices = vertices  # 多边形的顶点列表

    def is_inside(self, point):
        x, y = point  # 待判断的点的坐标

        # 使用射线法判断点是否在多边形内部
        intersect_count = 0
        num_vertices = len(self.vertices)
        for i in range(num_vertices):
            curr_vertex = self.vertices[i]
            next_vertex = self.vertices[(i + 1) % num_vertices]

            if curr_vertex[1] == next_vertex[1]:
                continue  # 跳过水平的边

            if (curr_vertex[1] <= y <= next_vertex[1] or
                next_vertex[1] <= y <= curr_vertex[1]) and \
                    x < (next_vertex[0] - curr_vertex[0]) * (y - curr_vertex[1]) / \
                    (next_vertex[1] - curr_vertex[1]) + curr_vertex[0]:
                intersect_count += 1

        return intersect_count % 2 == 1


class MultiPolygon:
    def __init__(self, polygons):
        self.polygons = polygons  # 多个多边形的列表

    def is_inside(self, point):
        for polygon in self.polygons:
            if polygon.is_inside(point):
                return True

        return False


# 坐标
polygon1 = Polygon([(44, 260), (211, 260), (211, 195), (44, 195)])
polygon2 = Polygon([(88, 10), (27, 78), (37, 146), (94, 163), (128, 75)])
polygon3 = Polygon([(127, 169), (150, 64), (175, 169)])
polygon4 = Polygon([(178, 98), (178, 16), (219, 10), (248, 48)])
polygon5 = Polygon([(219, 135), (235, 229), (270, 187)])
polygon6 = Polygon([(327, 154), (257, 154), (258, 17), (327, 17)])
polygon7 = Polygon([(371, 189), (336, 35), (361, 15), (382, 40)])
polygon8 = Polygon([(327, 265), (296, 240), (296, 192), (335, 161), (363, 192), (363, 243)])

multi_polygon = MultiPolygon([polygon1, polygon2, polygon3, polygon4, polygon5, polygon6, polygon7, polygon8])





